import React, { Component } from 'react'
import ClaChild from './ClaChild1'
import FuncChild from './FucChild2'
export default class Parent extends Component {
  constructor () {
    super()
    this.state = {
      isMan: true
    }
  }

  handleClick = val => {
    this.setState({
      isMan: val
    })
  }
  render () {
    return (
      <div>
        <p>Parent</p>
        <hr />
        <ClaChild
          name='李华'
          age={20}
          hobby={['阅读', '音乐', '打篮球']}
          address={{ province: '广西', city: '桂林' }}
          isMan={this.state.isMan}
          callback={this.handleClick}
        ></ClaChild>
        <FuncChild
          name='张磊'
          age={22}
          hobby={['阅读', '音乐', '打篮球']}
          address={{ province: '江西', city: '赣州' }}
        />
      </div>
    )
  }
}
